package cn.gson.fengboot.model.dao;


import cn.gson.fengboot.model.pojos.Dbuspro;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.transaction.annotation.Transactional;

public interface DbusproDao extends CrudRepository<Dbuspro,Integer>{


    @Transactional //必须添加这2个注解
    @Modifying   //必须添加这2个注解
    @Query(value="delete from dbuspro where bus_id = ?1",nativeQuery = true)
    void deleteAllBybusId(@Param(value = "busId") Integer busId);

}
